#ifndef TC_CAL_LIB_H_
#define TC_CAL_LIB_H_

#include "templib.h"

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct
    {
        float mV;      
        int32_t AdVal; 
    } tc_sample_type;

    typedef struct
    {
        uint8_t Err;         
        uint8_t sample_nums; 
        uint8_t bCFEn;
        int32_t AdcVal;
        float air_temp; 

        int16_t Pb;
        int16_t Pk;
        
        float TempLimiteL; 
        float TempLimiteH; 
        
        float Flt;
        float TempOrg;  
        float TempReal; 
        float TempCtr;  
        float TempDisp; 

        float coef; 

        int16_t iTempCtr;
        int16_t iTempDisp;
        int16_t iTempOrg;

        tc_sample_type Sample[4]; 

        uint8_t correct_point_len;
        temp_correct_mode_type correct_mode;
        void *correct_list;
        float (*t_to_v)(float t);
        float (*v_to_t)(float v);

    } tc_cal_type;

    float tc_k_cal(tc_cal_type *pt);
    float tc_k_cal_pbpk(tc_cal_type *tc);
    float tc_k_cal_imap(tc_cal_type *tc);

    float tc_r_cal(tc_cal_type *pt);
    float tc_r_cal_pbpk(tc_cal_type *tc);
    float tc_r_cal_imap(tc_cal_type *tc);

    float tc_e_cal(tc_cal_type *pt);
    float tc_e_cal_pbpk(tc_cal_type *tc);
    float tc_e_cal_imap(tc_cal_type *tc);

    float tc_j_cal(tc_cal_type *pt);
    float tc_j_cal_pbpk(tc_cal_type *tc);
    float tc_j_cal_imap(tc_cal_type *tc);

    float tc_s_cal(tc_cal_type *pt);
    float tc_s_cal_pbpk(tc_cal_type *tc);
    float tc_s_cal_imap(tc_cal_type *tc);

    float tc_t_cal(tc_cal_type *pt);
    float tc_t_cal_pbpk(tc_cal_type *tc);
    float tc_t_cal_imap(tc_cal_type *tc);

    float tc_n_cal(tc_cal_type *pt);
    float tc_n_cal_pbpk(tc_cal_type *tc);
    float tc_n_cal_imap(tc_cal_type *tc);

    float tc_b_cal(tc_cal_type *pt);
    float tc_b_cal_pbpk(tc_cal_type *tc);
    float tc_b_cal_imap(tc_cal_type *tc);

#ifdef __cplusplus
}
#endif

#endif 
